<?php

declare(strict_types=1);
/**
 *  -----------------------------------------------------
 *  Created by : tool
 *  -----------------------------------------------------
 *
 *  -----------------------------------------------------
 *
 *  -----------------------------------------------------
 *  User: tf <1096392101@qq.com>
 *  -----------------------------------------------------
 */
namespace Gao\tool\helper;

class Service
{
    /**
     * 获取当前协议.
     */
    public static function getHttpProtocol(): string
    {
        return ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
    }

    /**
     * 服务器系统
     */
    public static function getOS(): string
    {
        if (PATH_SEPARATOR == ':') {
            return 'Linux';
        }
        return 'Windows';
    }
}
